class Animal:
    __name = "hello"


# 私有变量无法在类的外部访问
"""
Traceback (most recent call last):
    ...
    print(Animal.__name)
          ^^^^^^^^^^^^^
AttributeError: type object 'Animal' has no attribute '__name'
"""
# print(Animal.__name)

my_dog = Animal()
"""
Traceback (most recent call last):
    ...
    print(my_dog.__name)
          ^^^^^^^^^^^^^
AttributeError: 'Animal' object has no attribute '__name'
"""
# print(my_dog.__name)

"""
    实际上python底层是对双下划线开头的变量做了个隐式转换
    变成了
    _类名__变量名
"""
print(Animal._Animal__name)#hello